package com.smedi.ismedi.cronjob.api.infrastructure.enumerate;

public enum CronTypeEnum {
    AGGREGATE(0, "指定集合"),

    SECTION(1, "指定区间"),

    INTERVAL(2, "指定间隔"),

    EVERY_TIME(3, "每次"),

    NONE(4, "不指定"),

    LAST(5, "最后一个"),

    WEEKEND(6, "周末");

    private String name;

    private int value;

    CronTypeEnum(int value, String name) {
        this.name = name;
        this.value = value;
    }

    public static String getName(int value) {
        for (CronTypeEnum c : CronTypeEnum.values()) {
            if (c.getValue() ==value) {
                return c.name;
            }
        }
        return null;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getValue() {
        return value;
    }

    public void setValue(int value) {
        this.value = value;
    }

}
